package com.ruoyi.system.service.customer.impl;

import com.ruoyi.system.domain.customer.CustomerLogin;
import com.ruoyi.system.mapper.customer.CustomerLoginMapper;
import com.ruoyi.system.service.customer.CustomerLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerLoginServiceImpl implements CustomerLoginService {

    @Autowired
    private CustomerLoginMapper customerLoginMapper;

    /**
     * 根据账号和密码查询
     * @param customerLogin
     * @return
     */
    public CustomerLogin selectCustomerLogin(CustomerLogin customerLogin){
        return customerLoginMapper.selectCustomerLogin(customerLogin);
    }

    /**
     * 添加信息
     * @param customerLogin
     * @return
     */
    public int addCustomerLogin(CustomerLogin customerLogin){
        return customerLoginMapper.addCustomerLogin(customerLogin);
    }

    /**
     * 修改信息
     * @param customerLogin
     * @return
     */
    public int editCustomerLogin(CustomerLogin customerLogin){
        return customerLoginMapper.editCustomerLogin(customerLogin);
    }

    @Override
    public CustomerLogin findCustListById(Long customerId) {
        return customerLoginMapper.findCustListById(customerId);
    }

    /**
     * 停用客户账号
     * @param customerLogin
     * @return
     */
    public int updateCustomerState(CustomerLogin customerLogin){
        return customerLoginMapper.editCustomerLogin(customerLogin);
    }

    @Override
    public int deleteCustomerLoginById(Integer customerId) {
        return customerLoginMapper.deleteCustomerLoginById(customerId);
    }
}
